clear all

** Set working directory: please set your own
/*
cd "~/Dropbox/sanctions_replication/"
*/
** Open dataset
use data/survey_clean.dta, clear

* Run the analyses
* Physical sanctions, sociodemographics 
regr intent_phis_vox_num fear_vox_num fear_age fear_woman fear_spanish female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_phis_interaction

* Verbal sanctions, sociodemographics 
regr intent_verb_vox_num fear_vox_num fear_age fear_woman fear_spanish female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_verbal_interaction

* Insult, sociodemographics 
regr intent_insult_vox_num fear_vox_num fear_age fear_woman fear_spanish female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_insult_interaction

* PCA direct sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_direct fear_vox_num fear_age fear_woman fear_spanish female_dummy age_calculated college spanish vox_vote_ccaa, r
est store pca_direct_interaction

* Deny help, sociodemographics (Madrid is ref category for regions)
regr intent_deny_vox_num fear_vox_num fear_age fear_woman fear_spanish female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_deny_interaction

* Avoid Interaction, sociodemographics (Madrid is ref category for regions)
regr intent_avoid_vox_num fear_vox_num fear_age fear_woman fear_spanish female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_avoid_interaction

* Gossip, sociodemographics (Madrid is ref category for regions)
regr intent_gossip_vox_num fear_vox_num fear_age fear_woman fear_spanish female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_gossip_interaction

* PCA indirect sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_indirect fear_vox_num fear_age fear_woman fear_spanish female_dummy age_calculated college spanish vox_vote_ccaa, r
est store pca_indirect_interaction

* PCA all sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_all fear_vox_num fear_age fear_woman fear_spanish female_dummy age_calculated college spanish vox_vote_ccaa, r
est store pca_all_interaction


* Make table
esttab vox_phis_interaction vox_verbal_interaction vox_insult_interaction pca_direct_interaction ///
vox_deny_interaction vox_avoid_interaction vox_gossip_interaction pca_indirect_interaction pca_all_interaction ///
using tables/tableb13.tex, tex nonumber ///
mtitles("Physical" "Verbal" "Insult" "Dir sanct (PCA)" "Gossip" "Deny help" "Avoid interact" "Ind sanct (PCA)" "All sanctions (PCA)" ) ///
coeflabels(female_dummy "Female (dummy)" age_calculated "Age" college "College" spanish "Spanish" ///
 fear_vox_num "Fear" fear_age "Fear x Age" fear_woman "Fear x Female" fear_spanish "Fear x Spanish" vox_vote_ccaa "Vox vote in Region" _cons "Constant") se ///
replace addnotes("Standard errors are robust")

